<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <div id="app">
      <input type="text" v-model='name' @keydown.13='submit'>
      <ul>
        <li v-for='(item,index) in ary' :key='item.qqq'>
          {{item.qqq}}
          <input type="checkbox">
          <button @click='del(index)'>X</button>
        </li>
      </ul>
    </div>
</body>
</html>
<script src="../node_modules/vue/dist/vue.js"></script>
<script>
   Vue.config.keyCodes.qqq = 112 // 自定义键盘吗的别名
    let vm = new Vue({
        el:'#app',
        data:{
            name:"珠峰",
            ary:[]
        },
        methods: {
          submit(){
            this.ary.push({name:this.name,qqq:Math.random()})
            this.name = ''
          },
          del(index){
            this.ary.splice(index,1);
          }
        },
    });
</script>